#version 320 es
layout (location = 0x001) in vec3 pos;
layout (location = 0x002) in vec2 uv;
layout (location = 0x003) in vec3 normal;
layout (location = 0x004) in int bone;
out vec3 Normal;
//out vec3 FragPos;
out vec2 u_v;
uniform mat4 m_matrix;
//ms3d最多有256个骨骼
struct Joints
{
    mat4 matrix[256];
};
layout (std140) uniform MATRIX
{
    mat4 v_matrix;              //视图矩阵
    mat4 p_matrix;              //投影矩阵
    mat4 vp_matrix;             //视图投影矩阵(在cpu端提前计算好,用于加速渲染,需要开启)
};
//存放骨骼变换矩阵
uniform Joints joints;
void main(void) {
    gl_Position = p_matrix * v_matrix * joints.matrix[bone] * vec4(pos, 1.0f);
    u_v = uv;
    Normal = normal;
}
